
#ifndef __QE_ARCH_H__
#define __QE_ARCH_H__



#include "qe_def.h"



void qe_interrupt_disable(void);
void qe_interrupt_enable(void);
void qe_irq_disable(int irq);
void qe_irq_unregister(int irq);
qe_ret qe_irq_enable(int irq);
qe_ret qe_irq_register(int irq, void (*handuler)(void *), void *ref);
void qe_irq_set_priority_trigger_type(qe_u32 irq, qe_u8 prior, qe_u8 trigger);


#ifdef __GNUC__
#if defined(__arm__)
__attribute__((always_inline)) static inline hy_ubase hy_get_fp(void) {
    register hy_ubase result;
    __asm volatile("MOV %0, fp\n" : "=r" (result));
    return(result);
}

__attribute__((always_inline)) static inline hy_ubase hy_get_sp(void) {
    register hy_ubase result;
    __asm volatile("MOV %0, sp\n" : "=r" (result));
    return(result);
}

__attribute__((always_inline)) static inline hy_ubase hy_get_pc(void) {
    register hy_ubase result;
    __asm volatile("MOV %0, pc\n" : "=r" (result));
    return(result);
}

__attribute__((always_inline)) static inline hy_ubase hy_get_lr(void) {
    register hy_ubase result;
    __asm volatile("MOV %0, lr\n" : "=r" (result));
    return(result);
}
#endif
#endif

#endif /* __QE_HW_H__ */
